import {createRouter,createWebHashHistory} from "vue-router"


// 1、声明routes配置，一个routes是一个数组，routes对象里面基本属性是由path和component组成

let routes = [
    {
        path:"/",
        component:()=>import("../pages1/home/index.vue"),
        name:"/", // 具名路由
        meta:{
            name:"导航首页",
        },
        children:[
            {
                path:"discover",
                component:()=>import("../pages1/discover/index.vue"),
                redirect:"/discover/playlist",
                name:"discover",
                meta:{
                    name:"发现首页"
                },
                children:[
                    {
                        path:"playlist",
                        component:()=>import("../pages1/discover/playlist/index.vue"),
                        name:"playlist",
                        meta:{
                            name:"歌单"
                        }
                    }
                ]
            },
            {
                path:"mine",
                name:"mine",
                meta:{
                    name:"个人中心"
                },
                component:()=>import("../pages1/mine/index.vue")
            },
            {
                path:"friend",
                name:"friend",
                meta:{
                    name:"朋友"
                },
                component:()=>import("../pages1/friend/index.vue")
            }
        ]
    },
    {
        path:"/login",
        name:"login",
        meta:{
            name:"登录"
        },
        component:()=>import("../pages1/login/index.vue")
    }
]

const router1 = createRouter({
    history:createWebHashHistory("/base"),
    routes
})

export default router1